<include file="Public:header"/>			
<div id="content">
	<div id="content-header">
		<h1>链接列表</h1>
		<div class="btn-group">
			<a href="{:U('Admin/Link/index')}" class="btn btn-large" title="新增链接"><i class="fa fa-file"></i></a>
		</div>
	</div>
	<div id="breadcrumb">
		<a href="#" title="回到首页" class="tip-bottom"><i class="fa fa-home"></i> 首页</a>
		<a href="#" class="current">链接列表</a>
	</div>
	<div class="row">
		<div class="col-xs-12">

			<div class="widget-box">
				<div class="widget-title">
					<span class="icon">
						<i class="fa fa-link"></i>
					</span>
					<h5>链接列表</h5>
					<span class="label label-info">{$num}条 </span>
				</div>
				<div class="widget-content">
					<table class="table table-bordered table-striped table-hover with-check">
						<thead>
							<tr>
								<th width="5%">链接编号</th>
								<th width="25%">名称</th>
								<th width="35%">描述</th>
								<th width="15%">显示位置</th>
								<th width="15%">操作</th>
							</tr>
						</thead>
						<tbody>
						<volist name="List" id="v">
							<tr>
								<td class="id">{$v.l_id}</td>
								<td>{$v.l_name}</td>
								<td>{$v.l_content|msubstr=0,80,'utf-8',true}</td>
								<td>
									<switch name="v['l_view']">
										<case value="0"><span class=" btn-dark-red btn-xs">不显示</span></case>
										<case value="1"><span class=" btn-dark-green btn-xs">内页显示</span></case>
										<case value="2"><span class=" btn-dark-green btn-xs">首页显示</span></case>
									</switch>
								</td>
								<td><a class="btn btn-success btn-sm" href="{:U('/Admin/Link/linkEdit',array('id'=>$v['l_id']))}">编辑</a>&nbsp;&nbsp;
									<button class="btn btn-danger btn-sm delL">删除</button></td>				
							</tr>	
							</volist>
						</tbody>
					</table>
					{$page}
				</div>
			</div>
		</div>
	</div>
</div>
<include file="Public:footer"/> 
<script>
$(document).ready(function(){
	$(".delL",this).click(function(){
		var id = $(this).parents("tr").find(".id").text();
		$(".delL").attr("disabled",true);
		$.ajax({
			type:"post",
			url:"/Admin/Link/linkDel",
			async:true,
			data:{"id":id},
			success:function(data){
				if(data.error==0){
					succ("完成!",data.msg,"__SELF__");
				}else{
					err("错误!",data.msg);
					$(".deltag").removeAttr('disabled');
				}
			},
		});
	});
});
</script>
</body>
</html>
